Skip to content

[no-ci] toolshed: modernize conda_create_for_pathfinder_testing scripts#2013

Open
rwgk wants to merge 1 commit intoNVIDIA:mainfrom
rwgk:toolshed_conda_create_for_pathfinder_modernizations
Open

[no-ci] toolshed: modernize conda_create_for_pathfinder_testing scripts#2013
rwgk wants to merge 1 commit intoNVIDIA:mainfrom
rwgk:toolshed_conda_create_for_pathfinder_modernizations

Conversation

@rwgk
Copy link
Copy Markdown
Contributor

@rwgk rwgk commented May 4, 2026

Modernizations as used for manually testing changes under PR #1977 (xref issue #1038) with Conda Linux and Windows:

Test results: #1977 (comment)

Separate PR to remove a distraction from the bigger set of changes.

Bring the bash and PowerShell helpers used to spin up CUDA-pathfinder
test environments into line with how cuda_pathfinder/pyproject.toml is
now organized, and harden them so common shell mistakes surface
immediately.

Highlights:

- Add ``set -euo pipefail`` (bash) and ``Set-StrictMode -Version Latest``
  (PowerShell) so unset variables and non-zero exit codes fail loudly.
- Pick the Python version from the CUDA major: ``12.x`` -> 3.12,
  ``13.x`` -> 3.14. Reject other CUDA majors with a clear error
  instead of silently installing 3.13.
- Bash: wrap ``conda activate`` and ``conda install`` in ``set +u`` /
  ``set -u`` because conda's shims dereference unset variables, which
  otherwise abort the script under ``set -u``.
- Realign the conda package lists with the platform-scoped groups in
  ``cuda_pathfinder/pyproject.toml``:
  - Add ``cutlass`` (Linux + Windows) and ``libcusolvermp-dev`` (Linux).
  - Drop ``libnvpl-fft-dev`` from the unconditional Linux list and from
    Windows entirely.
  - On Linux, install ``libnvpl-fft-dev`` only on ``aarch64`` and add
    ``libcudla-dev`` for the ``cu13``/``aarch64`` combination.
  - Drop ``libcublasmp-dev``, ``libcufftmp-dev``, ``libnvshmem3``, and
    ``libnvshmem-dev`` from the Windows list to match what ``pyproject``
    installs there.
- Refresh SPDX copyright to ``2025-2026``.

Co-authored-by: Cursor <cursoragent@cursor.com>
@rwgk rwgk added this to the cuda.pathfinder next milestone May 4, 2026
@rwgk rwgk self-assigned this May 4, 2026
@rwgk rwgk added P1 Medium priority - Should do test Improvements or additions to tests cuda.pathfinder Everything related to the cuda.pathfinder module labels May 4, 2026
@rwgk rwgk requested a review from rparolin May 4, 2026 17:30
)

$ErrorActionPreference = "Stop"
Set-StrictMode -Version Latest
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to spell out more what "modernization's" you are doing. I'm not sure what you are modernizing based on the code.

exit 1
fi

cuda_version="$1"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider: Refactoring these two scripts into a single python script to reduce maintenance headaches.


foreach ($cpkg in $cpkgs) {
Write-Host "CONDA INSTALL: $cpkg"
conda install -y -c conda-forge $cpkg
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider: Using batch install rather then running the resolve N times.

"This runs the conda solver N times instead of once, which is both much slower and can produce a different (worse) environment than solving all packages together — each install can independently downgrade/upgrade shared deps. A single conda install -y -c conda-forge "${cpkgs[@]}" is faster and more consistent."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.pathfinder Everything related to the cuda.pathfinder module P1 Medium priority - Should do test Improvements or additions to tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants